Downstream Message Push using JMS or SOAP on the WebLogic server

Overview

Downstream Message Push (DMP) adds ability to push messages downstream on completion of an activity before data is committed to DB. The functionality will be enabled by the configuration provided in business rule.

Scenario

In this business scenario we are setting the DownstreamMessagePush feature for the V12.2.0.0 version on the WebLogic server.

Pre-requisite

  1. The PAS.properties should be setup to define the environment to be used to send messages.

  2. Verify if the Rules Palette version is 12.2.0.x.

  3. Set up admin console for tracking the messages. Admin console has AcOutboundEvent table which capture all the messages sent and responses received. How to Setup Admin Console on WebLogic.

Step 1: Set Up

Modify the PAS.properties file

In the PAS.properties file add the following property:

#-----------------------------------------------------------------------
# Development mode is pointed to Development environment
# Production mode is pointed to Production environment
# Test mode is pointed to Test environment
#-----------------------------------------------------------------------
downstream.service.event.mode=Development
#-----------------------------------------------------------------------
# Required for viewing JMX events published on Admin Console. For DMP, outboundEventPush entity needs to be added
#-----------------------------------------------------------------------
jmx.notification.entities=cycle,login,activity,activityprofiling,outboundEventPush
jmx.notification.entities=cycle,login,activity,activityprofiling,outboundEventPush,serviceauditlogging

Step 2: JMS Set up on the Application(pas) Server

To Add the below steps the console should be in edit tree mode.

Step 2.1: Create a JMS Server

  1. Go to the Services > JMS Servers.

  2. Select New, and enter the following details

    • Name: DownstreamMessagePushJMSServer

    • Persistent Store: (none)

    • Target: AdminServer

Step 2.2: Create a JMS Module

  1. Go to Services > JMS Modules.

  2. Select New.

    • Name: DownstreamMessagePushJMSModule, leave the other options empty.

    • Targets: AdminServer

  3. Click save.

Step 2.3: Create a SubDeployment

  1. Go to Services > JMS Modules > DownstreamMessagePushJMSModules>Sub Deployments.

  2. On the Subdeployments tab and click New.

    • Subdeployment Name: DownstreamMessagePushSubdeployment.

    • Select the target(s) for the subdeployment. Choose either Managed Server or JMS Servers. (DownstreamMessagePushJMSServer) such as the JMS Server created earlier. As the purpose of our subdeployment in this is to target a specific JMS server, choose the JMS Server option.

    • Select the DownstreamMessagePushJMSServer created earlier.

  3. Click save.

Step 2.4: Create Connection Factory

  1. Go to Services > JMS Modules>DownstreamMessagePushJMSModule.

  2. Select Connection Factory option and click Next, enter the following values:

    • Name: DownstreamMessagePushConnectionFactory

    • JNDI Name: DownstreamMessagePushConnectionFactory

    • Leave the other fields as default.

    • Then select Sub Deployment Name as DownstreamMessagePushSubdeployment.

  3. Click Save, the new connection factory is created.

Step 2.5: Create a JMS Queue

  1. Go to Services > JMS Modules>DownstreamMessagePushJMSModule.

  2. Select Queue and click Next.

    • Name: Provide name of the message queue.

      • Example: DownstreamMessagePushQueue.

    • JNDI Name: Provide JNDI name.

      • Example: DownstreamMessagePushQueue.

    • Subdeployments: Give the name of the sub-deployment name in which Queue is supposed to be added.

      • Example: DownstreamMessagePushSubdeployment

  3. Click Save. The JMS queue is now complete and can be accessed using the JNDI names:

    • DownstreamMessagePushConnectionFactory, and

      • DownstreamMessagePushQueue.

Step 2.6: Enabling Tunneling for Adminserver (admin)

  1. Go to Environment > Servers.

  2. Click Adminserver(admin).

  3. Select Protocol tab and then select HTTP sub-tab.

  4. Select Enable Tunneling option.

Step 3: Create Transaction

To create a Transaction for the DownstreamMessagePush in Rules Palette:

  1. Go to Main Explorer > Companies > Prototype > Subsidiary Companies.

  2. In the Prototype Individual Child Company > Product > Individual Prototype Product > Plans > Functional Prototype Product.

  3. Select Transaction and right-click Transaction and click New Transaction.

  4. In the New Transaction text box, enter the name DownstreamMessagePush and click Next.

  5. Select the Transaction Type as Policy-Financial and click Next.

  6. Add the following configuration and check in the changes.

    <Transaction>
    <EffectiveDate STATUS="Enabled" TYPE="SYSTEM"/>
    <Fields>
    <Field>
    <Name>TextArea1</Name>
    <Display>Text Area 1 Field</Display>
    <DataType>TextArea</DataType>
    </Field>
    <Field>
    <Name>GraceMoney</Name>
    <Display>Grace Money Received</Display>
    <DataType>Money</DataType>
    <Currency>EUR,JPY,THB,TWD,USD</Currency>
    <DefaultValue>0</DefaultValue>
    </Field>
    <Field>
    <Name>SomeDate</Name>
    <Display>Date</Display>
    <DataType>Date</DataType>
    </Field>
    <Field>
    <Name>field2</Name>
    <Display>Grace Money Comment</Display>
    <DataType>Text</DataType>
    </Field>
    <Field>
    <Name>Test</Name>
    <Display>GraceMoney Comment21</Display>
    <DataType>Text</DataType>
    </Field>
    <Field>
    <Name>PolicyCurrencySupportTest1</Name>
    <Display>Bug Retest Currency21</Display>
    <DataType>Money</DataType>
    <DefaultValue>0</DefaultValue>
    </Field>
    <Field>
    <Name>PaymentMode</Name>
    <Display>PaymentMode</Display>
    <DataType>Decimal</DataType>
    <DefaultValue>1</DefaultValue>
    </Field>
    </Fields>
    <Math>
    <MathVariables>
    <MathVariable VARIABLENAME="True" TYPE="VALUE" DATATYPE="TEXT">01</MathVariable>
    <MathVariable VARIABLENAME="False" TYPE="VALUE" DATATYPE="TEXT">00</MathVariable>
    <MathVariable VARIABLENAME="ActivityEffectiveDate" TYPE="DATE" DATATYPE="FORMATDATE" OPERATION="CONVERT" TOFORMAT="YYYY-'W'ww-u">Activity:EffectiveDate</MathVariable>
    <MathVariable VARIABLENAME="EventDateTime" TYPE="DATE" DATATYPE="FORMATDATE" OPERATION="GENERATE" TOFORMAT="YYYY-'W'ww-u"/>
    <MathVariable VARIABLENAME="RequiredMV" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
    <MathVariable VARIABLENAME="ActivityEffDate" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
    <MathVariable VARIABLENAME="PaidToDate" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
    <MathVariable VARIABLENAME="BigTextMV1" TYPE="FIELD" DATATYPE="BIGTEXT">Activity:TextArea1</MathVariable>
    <MathVariable VARIABLENAME="payerName" TYPE="VALUE" DATATYPE="TEXT">Chris Snow</MathVariable>
    <MathVariable VARIABLENAME="isReBill" TYPE="VALUE" DATATYPE="BOOLEAN">false</MathVariable>
    </MathVariables>
    </Math>
    </Transaction>
  7. Go to Admin Explorer tab > Security > Application Security > Security folder.

  8. Select Prototype > Company Security > Transaction Security folder > Prototype Individual Child Company and then right-click to select Grant Access to All Transaction to provide the authorization for the Transaction.

  9. In the Functional Prototype Product > Plan Rule, select EligibleTransactionByPolicy Status add the newly created Transaction DownstreamMessagePushDefinition.

Step 4: Configure PushNotifications

To configure the PushNotification, perform the following:

  1. Go to the Rules Palette > Global Explorer > Business Rules.

  2. Select Attach Business Rule and right-click Attached Rule and select the New Global Rule for Category Attached.

  3. The New Global Rule window appears, enter the new business Rule name as PushNotifications and click Next.

  4. Select Transaction and click Next (select the transaction where we want to override this new business rule) and click Next.

  5. Click Finish, then PushNotifications Business rule is created.

  6. Add the below configuration example and checking the rule.

  7. Evenetname used in the following configuration need to be created using Downstream Message Push for REST.

    Example: <PushNotification EVENTNAME="Billing">

    <PushNotifications>
    <Templates>
    <Template ID="Header">
    <JSTLMessage>
    <Parameters>
    <Parameter DATATYPE="FORMATDATE" NAME="ActivityEffectiveDate">ActivityEffectiveDate</Parameter>
    <Parameter DATATYPE="Text" NAME="ActivityGUID">Activity:ActivityGUID</Parameter>
    </Parameters>
    <ActivityGUID>[ActivityGUID]</ActivityGUID>
    <ActivityEffectiveDate>[ActivityEffectiveDate]</ActivityEffectiveDate>
    <EventDateTime>[EVENTDATETIME]</EventDateTime>
    </JSTLMessage>
    </Template>
    <Template ID="Header1">
    <JSTLMessage>
    <Parameters>
    <Parameter DATATYPE="Date" NAME="EFFdate">Activity:EffectiveDate</Parameter>
    </Parameters>
    <EffectiveDate>[EFFdate]</EffectiveDate>
    </JSTLMessage>
    </Template>
    </Templates>
    <!-- Sample message template -->
    <PushNotification EVENTNAME="Billing">
    <Message ID="BillingMsg1">
    <Tests>
    <Test>1=1</Test>
    <Test>1=1</Test>
    </Tests>
    <AsEventMessage xmlns="http://xmlns.alamere.com/PAS/AsEventMessage">
    <JSTLTemplate>Header</JSTLTemplate>
    <JSTLTemplate>Header1</JSTLTemplate>
    <JSTLMessage>
    <Parameters>
    <Parameter DATATYPE="TEXT" NAME="payerName">payerName</Parameter>
    <Parameter DATATYPE="BOOLEAN" NAME="isReBill">isReBill</Parameter>
    <Parameter DATATYPE="BIGTEXT" NAME="BigTextMV1">BigTextMV1</Parameter>
    <Parameter DATATYPE="Date" NAME="RequiredMV">RequiredMV</Parameter>
    </Parameters>
    <Billing>
    <Reversal>[REVERSAL]</Reversal>
    <BigTextMV1>[BigTextMV1]</BigTextMV1>
    <payerName>[payerName]</payerName>
    <isReBill>[isReBill]</isReBill>
    </Billing>
    <Premium>
    <Area>[BigTextMV1]</Area>
    <Date>[RequiredMV]</Date>
    </Premium>
    </JSTLMessage>
    </AsEventMessage>
    </Message>
    </PushNotification>
    <OnPushFailure>
    <RollbackTransaction>Yes</RollbackTransaction>
    <CreateBusinessError>Yes</CreateBusinessError>
    </OnPushFailure>
    </PushNotifications>
  8. Outbound configuiration should be as:

{"providerUrl":"t3://xxx.xx.xxx.xx:xxxx",
"connectionFactory":"openejb:Resource/DownstreamMessagePushConnectionFactory",
"destinationName":"openejb:Resource/DownstreamMessagePushQueue",
"deliveryMode":"DeliveryMode.NONPERSISTENT",
"acknowledgementMode":"AUTO_ACKNOWLEDGE",
"timeToLive":"5000000",
"priorityLevel":1} ------ out bound configuration

Step 5: Process Activity in OIPA

View Messages sent to Downstream console

Monitoring Tree >Services >Messaging >JMS Runtime> JMS Server> DownstreamMessagePushJMSServer>destination > click on DownstreamMessagePushJMSModule!DownstreamMessagePushQueue> Messages.

Sample Configuration:

Transaction :
<Transaction>
<EffectiveDate STATUS="Enabled" TYPE="SYSTEM"></EffectiveDate>
<Fields>
<Field>
<Name>TextArea1</Name>
<Display>Text Area 1 Field</Display>
<DataType>TextArea</DataType>
</Field>
<Field>
<Name>GraceMoney</Name>
<Display>Grace Money Received</Display>
<DataType>Money</DataType>
<Currency>EUR,JPY,THB,TWD,USD</Currency>
<DefaultValue>0</DefaultValue>
</Field>
<Field>
<Name>SomeDate</Name>
<Display>some Date</Display>
<DataType>Date</DataType>
</Field>
<Field>
<Name>field2</Name>
<Display>GraceMoney Comment</Display>
<DataType>Text</DataType>
</Field>
<Field>
<Name>Test</Name>
<Display>GraceMoney Comment21</Display>
<DataType>Text</DataType>
</Field>
<Field>
<Name>PolicyCurrencySupportTest1</Name>
<Display>Bug Retest Currency21</Display>
<DataType>Money</DataType>
<DefaultValue>0</DefaultValue>
</Field>
<Field>
<Name>PaymentMode</Name>
<Display>PaymentMode</Display>
<DataType>Decimal</DataType>
<DefaultValue>1</DefaultValue>
</Field>
<Field>
<Name>dummy</Name>
<Display>dummy</Display>
<DataType>Decimal</DataType>
<DefaultValue>1</DefaultValue>
</Field>
</Fields>
<Math>
<MathVariables>
<MathVariable VARIABLENAME="True" TYPE="VALUE" DATATYPE="TEXT">01</MathVariable>
<MathVariable VARIABLENAME="False" TYPE="VALUE" DATATYPE="TEXT">00</MathVariable>
<MathVariable VARIABLENAME="ActivityEffectiveDate" TYPE="DATE" DATATYPE="FORMATDATE" OPERATION="CONVERT" TOFORMAT="YYYY-'W'ww-u">Activity:EffectiveDate</MathVariable>
<MathVariable VARIABLENAME="ActivityEffectiveDate2" DATATYPE="DATE" TYPE="FIELD">Activity:EffectiveDate</MathVariable>
<MathVariable VARIABLENAME="ActivityEffectiveDate3" TYPE="DATEARRAY" DATATYPE="DATE" LOG="Yes" OPERATION="FILLBY-SQL">select AsActivity.EffectiveDate from AsActivity where activityguid='9E1A931A-D96F-4DC1-A075-2C0A3447D2A2'</MathVariable>
<MathVariable VARIABLENAME="EventDateTime" TYPE="DATE" DATATYPE="FORMATDATE" OPERATION="GENERATE" TOFORMAT="yyMMddHHmmss"></MathVariable>
<MathVariable VARIABLENAME="EventDateTime1" TYPE="DATE" DATATYPE="FORMATDATE" OPERATION="GENERATE" TOFORMAT="HHmmssSSS"></MathVariable>
<MathVariable VARIABLENAME="RequiredMV" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
<MathVariable VARIABLENAME="ActivityEffDate" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
<MathVariable VARIABLENAME="PaidToDate" TYPE="FIELD" DATATYPE="DATE">Activity:EffectiveDate</MathVariable>
<MathVariable VARIABLENAME="BigTextMV1" TYPE="FIELD" DATATYPE="BIGTEXT">Activity:TextArea1</MathVariable>
<MathVariable VARIABLENAME="payerName" TYPE="VALUE" DATATYPE="TEXT">Chris Snow</MathVariable>
<MathVariable VARIABLENAME="isReBill" TYPE="VALUE" DATATYPE="BOOLEAN">false</MathVariable>
<MathVariable VARIABLENAME="paymentmodeint" TYPE="FIELD" DATATYPE="INTEGER">Activity:PaymentMode</MathVariable>
<MathVariable VARIABLENAME="DecimalMV" TYPE="VALUE" DATATYPE="DECIMAL">0</MathVariable>
<MathVariable VARIABLENAME="DaysToMaturity" TYPE="VALUE" DATATYPE="INTEGER">0</MathVariable>
<MathVariable VARIABLENAME="Company" TYPE="VALUE" DATATYPE="TEXT">Company</MathVariable>
<MathVariable VARIABLENAME="IntegerArray" TYPE="INTEGERARRAY" OPERATION="FILLBY-LIST" LOG="YES" DATATYPE="INTEGER">1,3,5,7</MathVariable>
<MathVariable VARIABLENAME="SuspenseNumberMV" TYPE="IDENTIFIER" DATATYPE="TEXT">
<Parts>
<Part TYPE="SEQUENCE" FORMAT="0000000000">SuspenseBatchNumber</Part>
</Parts>
</MathVariable>
</MathVariables>
</Math>
</Transaction>
=======================================================================================================================================================================================================================================
Push notification :
<PushNotifications>
<Templates>
<Template ID="Header">
<JSTLMessage>
<Parameters>
<Parameter DATATYPE="FORMATDATE" NAME="ActivityEffectiveDate">ActivityEffectiveDate</Parameter>
<Parameter DATATYPE="Text" NAME="ActivityGUID">Activity:ActivityGUID</Parameter>
</Parameters>
<ActivityGUID>[ActivityGUID]</ActivityGUID>
<ActivityEffectiveDate>[ActivityEffectiveDate]</ActivityEffectiveDate>
<EventDateTime>[EVENTDATETIME]</EventDateTime>
</JSTLMessage>
</Template>
<Template ID="Header1">
<JSTLMessage>
<Parameters>
<Parameter DATATYPE="Date" NAME="EFFdate">Activity:EffectiveDate</Parameter>
</Parameters>
<EffectiveDate>[EFFdate]</EffectiveDate>
</JSTLMessage>
</Template>
</Templates>
<!-- Sample message template -->
<PushNotification EVENTNAME="Billing">
<Message ID="BillingMsg1">
<Tests>
<Test>1=1</Test>
<Test>1=1</Test>
</Tests>
<AsEventMessage
xmlns="http://xmlns.alamere.com/PAS/AsEventMessage">
<JSTLTemplate>Header</JSTLTemplate>
<JSTLTemplate>Header1</JSTLTemplate>
<JSTLMessage>
<Parameters>
<Parameter DATATYPE="TEXT" NAME="payerName">payerName</Parameter>
<Parameter DATATYPE="BOOLEAN" NAME="isReBill">isReBill</Parameter>
<Parameter DATATYPE="BIGTEXT" NAME="BigTextMV1">BigTextMV1</Parameter>
<Parameter DATATYPE="Date" NAME="RequiredMV">RequiredMV</Parameter>
</Parameters>
<Billing>
<Reversal>[REVERSAL]</Reversal>
<BigTextMV1>[BigTextMV1]</BigTextMV1>
<payerName>[payerName]</payerName>
<isReBill>[isReBill]</isReBill>
</Billing>
<Premium>
<Area>[BigTextMV1]</Area>
<Date>[RequiredMV]</Date>
</Premium>
</JSTLMessage>
</AsEventMessage>
</Message>
</PushNotification>
<OnPushFailure>
<RollbackTransaction>Yes</RollbackTransaction>
<CreateBusinessError>Yes</CreateBusinessError>
</OnPushFailure>
</PushNotifications>
=======================================================================================================================================================================================================================================
OutBoundConfiguration used for Billing event
{"providerUrl":"http://100.76.152.110:8010","connectionFactory":"DownstreamMessagePushConnectionFactory","destinationName":"DownstreamMessagePushQueue","priorityLevel":4,"deliveryMode":"DeliveryMode.PERSISTENT","acknowledgementMode":"AUTO_ACKNOWLEDGE"}